package com.study.money;

import com.alibaba.fastjson.JSONArray;

import java.util.Date;
import java.util.Map;

/**
 * TODO
 *
 * @author wanghuilong
 * @version 1.0
 * @date 2022/2/11 10:45 上午
 */
public class Test4 {


    public static void main(String[] args) {
        Test3.init();
        Date date = new Date();
        FundTypeEnum fundType = FundTypeEnum.FUND;

        for (Map.Entry<String, String> entry : Test1.jijinMap.entrySet()) {
            String code = entry.getKey();
            String name = entry.getValue();
            Test3.checkAndSaveFund(code, fundType.getDesc(), name);

            JSONArray data = Test1.getData(code, date, Test1.TimeTypeEnum.TEN_YEAR);
            Test3.saveData(data);
        }
    }

    //jsonpgz({"fundcode":"000689","name":"鍓嶆捣寮€婧愭柊缁忔祹娣峰悎A","jzrq":"2022-02-10","dwjz":"2.9859","gsz":"2.9235","gszzl":"-2.09","gztime":"2022-02-11 15:00"});
    //天天基金接口当日净值增长不准/ **数据格式：{
    // “ fundcode”：“ 161725”，//基金代码“
    // name”：“招商中证白酒指数（LOF）”“，//基金名称“
    // jzrq”：“ 2021-02-09”，//上一个结算日期“
    // dwjz”：“ 1.5439”，//上一个结算日期的单位净值“
    // gsz”：“ 1.6183”，//盘中实时净值投放“
    // gszzl”：“ 4.82”，//日投放“
    // gztime”：“ 2021-02-10 15:00” //最后更新日期} * /
    public static void initFund(String code, FundTypeEnum fundType) {

    }

}
